package com.lg.concurrent.pool;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * 周期性 调用
 * 延迟 以 固定的延迟节奏  执行任务
 */
public class DelayedWorkQueueTest {
    public static void main(String[] args) {
        //DelayedWorkQueue

//        ScheduledThreadPoolExecutor.DelayedWorkQueue()
//        不是公共的 是 default

        ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(3);
        scheduledExecutorService.schedule(()->{
            System.out.println("aaa");
        },1, TimeUnit.SECONDS);


    }
}
